A value can be represented in various formats, such as in a fixed-point format or a floating-point format. The fixed-point format refers to using an integer part and a fractional part. For example, the 16 most significant bits of a 32-bit binary number can be used to represent the integer, while the 16 least significant bits can be used to represent the fractional part. In the case of binary fixed-point numbers, each integer bit represents a power of two, while each fractional bit represents an inverse power of two. For example, the first fractional bit is ½, the second is ¼, the third is ⅛, and so forth.
Typically, signed fixed-point numbers use a two's complement format, as depicted in Table 1 below, to represent positive and negative values. When two's complement arithmetic is used, the first bit represents the sign bit. Referring to the first row of Table 1, the sign bit of binary value 0000 0101 is “0,” which in two's complement represents a positive value. The remaining bits, 000 0101, have a value of 5 (i.e., 1*20+0*21+1*22+0*23+0*24+0*25+0*26=5). Rows 2-5 depict other examples of base-ten numbers and the corresponding two's complement binary values. Row 6 depicts the all zero case, while rows 7-11 depict examples of negative base-ten numbers and their corresponding two's complement binary numbers. The sign bit of “1” in the binary values of rows 7-11 represents a negative value. Although Table 1 only depicts values between 5 and −5, a two's-complement can represent other values as well.
TABLE 1Example of Base Ten Values and Corresponding Two'sComplement Binary ValuesBase TenRowValueBinary Value150000 0101240000 0100330000 0011420000 0010510000 0001600000 00007−11111 11118−21111 11109−31111 110110−41111 110011−51111 1011
A value may also be represented as a floating-point value by using a sign bit, a mantissa (also referred to as a significand or a coefficient), and an exponent. For example, the number 123.45 can be represented as a decimal floating-point number with a mantissa of 12345 and an exponent of −2 (i.e., 12345×10−2). In the case of binary floating-point numbers, these numbers are typically stored in a format having a sign bit, a mantissa, and an exponent. There are various standards that define the format for floating-point binary values. One of those standards is IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985). Although most computers perform computations using floating-point processors for processing floating-point binary values, many smaller, embedded processors, such as the embedded processors used in some telecommunication devices (e.g., base stations, client stations, handsets, and the like), are not capable of processing floating-point values, and, as such, use fixed-point values.